<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 
 
 <!--  <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>系统登录</title>
<link rel="stylesheet" href="extjs4/resources/css/ext-all.css" type="text/css"></link>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script type="text/javascript" src="extjs4/ext-all-debug.js"></script>
<script type="text/javascript" src="extjs4/locale/ext-lang-zh_CN.js"></script> 
<style type="text/css">
.text-user {
	background: url('resources/images/user.png') no-repeat !important;
	padding: 2px 0 2px 18px;
}

.text-lock {
	background: url('resources/images/lock.gif') no-repeat !important;
	padding: 2px 0 2px 18px;
}

.login {
	background-image: url(resources/images/blogin.png ) !important;
}

.reset {
	background-image: url(resources/images/login-reset.png ) !important;
}
</style>
<script type="text/javascript" src="app/view/loginTest.js"></script> 
</head>
<body style="background-color:#CCCCCC;">
	<div id="center-div"></div>
</body>
</html>
-->
 
<%@ taglib prefix="sf" uri="http://www.springframework.org/tags" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>系统登录</title>
<link href="resources/css/login.css" rel="stylesheet" type="text/css" />
<SCRIPT language=Javascript>
<!--
function isLegal(ch)
{
if(ch >= '0' && ch <= '9')return true;
if(ch >= 'a' && ch <= 'z')return true;
if(ch >= 'A' && ch <= 'Z')return true;
return false;
}
function isAllLegal(str1)
{
for (i=0; i<str1.length; i++) {
   if (!isLegal(str1.charAt(i)))
   {
    return false;
   }
}
return true;
}
function valid_login(){

var str = login_form.j_username.value;
if(!isAllLegal(str)){
   alert("名字含有非法字符（只能含有字母和数字）");
   login_form.j_username.focus();
   return false;
}else if(login_form.j_username.value == ""){
   alert("请输入用户名！");
   login_form.j_username.focus();
   return false;
}else if(login_form.j_password.value == ""){
   alert("请输入密码！");
   login_form.j_password.focus();
   return false;
}else if(login_form.j_captcha.value == ""){
   alert("请输入验证码！");
   login_form.j_captcha.focus();
   return false;
}
return true;
}
-->
</SCRIPT>
</head>
<sf:url var="authUrl"
value="/j_spring_security_check" />

<form name='login_form' id='login_form' method="post" class="signin" action="${authUrl}" onsubmit="return valid_login();">
<div class="Main">
        <ul>
            <li class="top"></li>
            <li class="top2"></li>
            <li class="topA"></li>
            <li class="topB"><span>
                <img src="resources/images/login/logo.gif" alt="" style="" />
            </span></li>
            <li class="topC"></li>
            <li class="topD">
                <ul class="login">
                	<li>
                		<span class="text">
                			<div style="display: ${param.error == true ? '' : 'none'}">
								 <font style='color: red'> 登陆失败 原因: ${sessionScope['SPRING_SECURITY_LAST_EXCEPTION'].message}</font>
							</div>
						</span>
                	</li>
                    <li>
                    	<span class="left">用户名：</span> 
                    	<span style="left">
                        	<input id="j_username"  name="j_username" type="text" class="txt" />
                        </span>
                    </li>
                    <li>
                    	<span class="left">密   码：</span> 
                        <span style="left">
                       		<input id="j_password"  name="j_password" type="password" class="txt" />  
                    	</span>
                    </li>
                    <li>
                        <span class="left">验证码：</span> 
                        <span class="left2">
                        	<input id="Text3" type="text" name="j_captcha" class="txtCode" />
                       		<img alt="点击刷新"  width="80" height="35" align="middle" src="./imageServlet" onclick="this.src=this.src+'?'">
                        </span>
                    </li>
                </ul>
            </li>
            <li class="topE"></li>
            <li class="middle_A"></li>
            <li class="middle_B"></li>
            <li class="middle_C">
            <br>
            <span class="btn">
				<input type="submit" value="" style="background:url(resources/images/login/btnlogin.gif); border-style:none;  width:124px; height:35px; background-repeat:no-repeat;"  /> 
            </span>
            </li>
            <li class="middle_D"></li>
            <li class="bottom_A"></li>
            <li class="bottom_B"></li>
        </ul>
    </div>
  </form>
</html>
